// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Item {
    id: data
    width: 0
    height: 0

    property string curr_pos_x: "114.0"
    property string curr_pos_y: "34.0"

    property string citycode : ""
    property string start_x : ""
    property string start_y : ""
    property string start_name : ""
    property string start_address : ""
    property string start_tel : ""
    property string start_pid : ""
    property string start_citycode : ""
    property string start_cityname : ""
    property string start_detailLink : ""
    property string start_type : ""

    property string end_x : ""
    property string end_y : ""
    property string end_name : ""
    property string end_address : ""
    property string end_tel : ""
    property string end_pid : ""
    property string end_citycode : ""
    property string end_cityname : ""
    property string end_detailLink : ""
    property string end_type : ""

    ///////////////////////////////////////////////////////////////////////////////////////////     poi search
    ListModel
    {
        id: model_poi_search
    }

    function add_model_poi(distance, pguid, address, tel, name, srctype, type, y, x)
    {
        model_poi_search.append(
                    {
                        "distance": distance
                        ,"pguid": pguid
                        ,"address": address
                        ,"tel": tel
                        ,"name": name
                        ,"srctype": srctype
                        ,"type":type
                        ,"poi_y": y
                        ,"poi_x": x
                    }
                    );
    }

    function clear_model_poi()
    {
        model_poi_search.clear();
    }

    function get_model_poi()
    {
        return model_poi_search;
    }

    ///////////////////////////////////////////////////////////////////////////////////////////     bus navi
    ListModel
    {
        id: model_bus_navi
    }

    function add_model_busnavi(bounds, footEndLength, segmentList)
    {
        model_bus_navi.append(
                    {
                        "bounds": bounds
                        ,"footEndLength": footEndLength
                        ,"segmentList": segmentList
                    }
                    );
    }

    function clear_model_busnavi()
    {
        model_bus_navi.clear();
    }

    function get_model_busnavi()
    {
        return model_bus_navi;
    }

    ///////////////////////////////////////////////////////////////////////////////////////////     bus station
    ListModel
    {
        id: model_bus_station
    }

    function add_model_busstation(terminal_name, line_id, type, end_time, name, company, length, start_time)
    {
        model_bus_station.append(
                    {
                        "terminal_name": terminal_name
                        ,"line_id": line_id
                        ,"type": type
                        ,"end_time": end_time
                        ,"name": name
                        ,"company": company
                        ,"length":length
                        ,"start_time": start_time
                    }
                    );
    }

    function clear_model_busstation()
    {
        model_bus_station.clear();
    }

    function get_model_busstation()
    {
        return model_bus_station;
    }

    ///////////////////////////////////////////////////////////////////////////////////////////     bus line
    ListModel
    {
        id: model_bus_line
    }

    function add_model_busline(stationNum, name, code, x, y)
    {
        model_bus_line.append(
                    {
                        "stationNum": stationNum
                        ,"name": name
                        ,"code": code
                        ,"poi_y": y
                        ,"poi_x": x
                    }
                    );
        //console.log("busline model length : " + model_bus_line.count);
    }

    function clear_model_busline()
    {
        model_bus_line.clear();
    }

    function get_model_busline()
    {
        return model_bus_line;
    }

    ///////////////////////////////////////////////////////////////////////////////////////////     car navi
    ListModel
    {
        id: model_car_navi
    }

    function add_model_car(locationCode, form, coor, direction, roadLength, action, grade, textInfo, accessorialInfo, roadName, driveTime)
    {
        model_car_navi.append(
                    {
                        "locationCode": locationCode
                        ,"form": form
                        ,"coor": coor
                        ,"direction": direction
                        ,"roadLength": roadLength
                        ,"action": action
                        ,"grade":grade
                        ,"textInfo": textInfo
                        ,"accessorialInfo": accessorialInfo
                        ,"roadName": roadName
                        ,"driveTime": driveTime
                    }
                    );
    }

    function clear_model_car()
    {
        model_car_navi.clear();
    }

    function get_model_car()
    {
        return model_car_navi;
    }
}
